package com.zl.customer.mapper;/**
 * @author suke
 * @create 2021-07-07 10:31
 */

import com.zl.customer.pojo.Customer;
import com.zl.customer.pojo.CustomerCondition;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * TODO
 * @InterfaceName: CutsomerDao
 * @author: suke
 * @since: 2021/7/7 10:31
 */
public interface CustomerMapper {
    /**
     * 查询所有客户信息
     * @return
     */
    List<Customer> queryAll() throws Exception;

    /**
     * 执行insert操作
     * @param customer
     * @return
     */
    int insert(Customer customer) throws Exception;

    int delete(int id) throws Exception;

    Customer queryById(int id) throws Exception;


    /**
     * 查询总记录数, 无条件
     * @return
     */
    long count() throws Exception;


    /**
     * 查询总记录数, 带条件
     * @return
     */
    long count(@Param("condition") CustomerCondition condition) throws Exception;

    /**
     * 分页查询 记录数  条件
     * @param  condition: 条件
     */
    List<Customer> queryByPage(@Param("condition") CustomerCondition condition) throws Exception;
}
